﻿using Orchard.Localization;
using Orchard.UI.Navigation;
namespace NineSeas.LanguageEditor
{
    public class AdminMenu: INavigationProvider
    {
        public string MenuName
        {
            get { return "admin"; }
        }

        public AdminMenu()
        {
            T = NullLocalizer.Instance;
        }

        private Localizer T { get; set; }

        public void GetNavigation(NavigationBuilder builder)
        {
            builder

                // Image set
                .AddImageSet("language-editor")

                // "Webshop"
                .Add(item => item

                    .Caption(T("Language Editor"))
                    .Position("10")
                    .LinkToFirstChild(true)

                    // "Books"
                    .Add(subItem => subItem
                        .Caption(T("Editor"))
                        .Position("1.1")
                        .Action("Index", "EditorAdmin", new { area = "LanguageEditor" })
                    )

                );
        }
    }
}